<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="umsroot.css">
<TITLE>
Interprocess Communication
</TITLE>
</HEAD>
<BODY >
<A HREF="umsroot124.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot135.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H1 CLASS="chapter"><A NAME="htoc291">Chapter&nbsp;21</A>&nbsp;&nbsp;Interprocess Communication</H1>

<A NAME="sockets"></A>
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> contains built-in predicates that support interprocess communications
using sockets.
Sockets implement bidirectional channels
that can connect multiple processes on different machines
in different networks.
The socket predicates are directly mapped to the system calls
and therefore detailed information can be found in the Unix manuals.<BR>
<BR>
Sockets in general allow a networked communication among many processes,
where each packet sent by one process can be sent to different address.
In order to limit the number of necessary built-in predicates,
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> supports only point-to-point communication based
on stream or datagram sockets, or many-to-one communication
based on datagrams.
Broadcasting as well as using one socket to send data
to different addresses is not supported, except that
datagram sockets can be re-connected, so that the same
socket is directed to another address.
Below we describe the basic communication types that are available
in ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>.<BR>
<BR>
Note that the sockets streams in ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> are buffered like
all other streams, and so it is necessary to flush
the buffer in order to actually send the data to the socket.
This can be done either with the <A HREF="../bips/kernel/iostream/flush-1.html"><B>flush/1</B></A><A NAME="@default1169"></A> predicate
or with the option <B>%b</B> in <A HREF="../bips/kernel/ioterm/printf-2.html"><B>printf/2, 3</B></A><A NAME="@default1170"></A>.<BR>
<BR>
<UL>
<LI><A HREF="umsroot130.html">Socket Domains</A>
<LI><A HREF="umsroot131.html">Stream Connection (internet domain)</A>
<LI><A HREF="umsroot132.html">Datagram Connection (internet domain)</A>
<LI><A HREF="umsroot133.html">Stream Connection (unix domain)</A>
<LI><A HREF="umsroot134.html">Datagram Connection (unix domain)</A>
</UL>

<BR>
<BR>
<HR WIDTH="50%" SIZE=1><DL CLASS="list"><DT CLASS="dt-list"><A NAME="note32" HREF="umsroot132.html#text32"><FONT SIZE=5>1</FONT></A><DD CLASS="dd-list">The packet boundaries are not of much
interest in Prolog because every Prolog term represents itself
a message with clear boundaries.
</DL>
<HR>
<A HREF="umsroot124.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot135.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
